package ru.pstu.itas.cps.controls;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Rect;

public class BackgroundImage extends ControlElement {

	Bitmap img = null;

	public BackgroundImage(Bitmap img) {
		this.img = img;
	}

	@Override
	public void Draw(Canvas canvas) {
		if (img != null) {
			Rect srcRect = new Rect(0, 0, img.getWidth(), img.getHeight());
		    Rect dstRect = new Rect(0, 0, img.getWidth(), img.getHeight());
			canvas.drawBitmap(img, srcRect, dstRect, null);
		}
	}

	public Bitmap getImg() {
		return img;
	}

}
